﻿@page "/SysClientTask/Details/{id}"
@using SelfService.ViewModel.SysClientTaskVMs;
@inherits BasePage

<ValidateForm @ref="vform" Model="@Model" >
    <Row ItemsPerRow="ItemsPerRow.Two" RowType="RowType.Normal">

            <Display @bind-Value="@Model.Entity.Action"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.ClientId" Lookup="@AllSysClients"  ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.CreateTime"   ShowLabel="true"/>
            <Display @bind-Value="@Model.Entity.UpdateTime"   ShowLabel="true"/>
    </Row>
    <div class="modal-footer table-modal-footer">
        <Button Color="Color.Primary" Icon="fa fa-save" Text="@WtmBlazor.Localizer["Sys.Close"]" OnClick="OnClose" />
    </div>
</ValidateForm>

@code {

    private SysClientTaskVm Model = null;
    private ValidateForm vform { get; set; }
    [Parameter]
    public string id { get; set; }

    private List<SelectedItem> AllSysClients = new List<SelectedItem>();


    protected override async Task OnInitializedAsync()
    {

        AllSysClients = await WtmBlazor.Api.CallItemsApi("/api/SysClientTask/GetSysClients", placeholder: WtmBlazor.Localizer["Sys.All"]);

        var rv = await WtmBlazor.Api.CallAPI<SysClientTaskVm>($"/api/SysClientTask/{id}");
        Model = rv.Data;
    }

    public void OnClose()
    {
        CloseDialog();
    }

}
